<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
  
  <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
  <title>Winform Development</title>

  
  
  <meta name="id" content="64e3dc97-5125-541e-9e84-7f9303e95f27">

  
  <meta name="revisionNumber" content="1">

</head><body>
<p class="MsoNormal" style="margin-left: 22.5pt; font-family: Helvetica,Arial,sans-serif;"><b style=""><span style="font-size: 10pt; line-height: 115%;"><big><big>Toolbox
Configuration</big></big><br>
</span></b><span style=""><o:p></o:p></span></p>

<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 22.5pt; line-height: normal; font-family: Helvetica,Arial,sans-serif;">
</p>

<p class="MsoNormal" style="margin-left: 22.5pt; font-family: Helvetica,Arial,sans-serif;"><span>If
you are developing
a <b style="">Winform</b> application you should add the
FacebookService component to your toolbox in Visual Studio. To do this,
right-click in the area of the toolbox where you want the controls to
go, and
select &#8220;Choose Items&#8221; from the pop-up menu.<o:p></o:p><br>
<v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"><v:stroke joinstyle="miter"><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"><v:f eqn="sum @0 1 0"><v:f eqn="sum 0 0 @1"><v:f eqn="prod @2 1 2"><v:f eqn="prod @3 21600 pixelWidth"><v:f eqn="prod @3 21600 pixelHeight"><v:f eqn="sum @0 0 1"><v:f eqn="prod @6 1 2"><v:f eqn="prod @7 21600 pixelWidth"><v:f eqn="sum @8 21600 0"><v:f eqn="prod @7 21600 pixelHeight"><v:f eqn="sum @10 21600 0"></v:f><v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"><o:lock v:ext="edit" aspectratio="t"></o:lock><v:shape id="_x0000_i1025" type="#_x0000_t75" style="width: 242.25pt; height: 218.25pt;"><v:imagedata src="file:///C:%5CUsers%5CRPOWER%7E1.CLA%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_image001.png" o:title="chooseItemsMenu"></v:imagedata></v:shape></v:path></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:formulas></v:stroke></v:shapetype><br>
In the window that appears, click the &#8220;Browse&#8230;&#8221; button, locate
Facebook.Winforms.dll,
and open it. Click &#8220;OK&#8221;, and the FacebookService component and the
various user controls should appear in your toolbox.&nbsp;&nbsp; <o:p></o:p></span></p>

<p class="MsoNormal" style="margin-left: 22.5pt; font-family: Helvetica,Arial,sans-serif;"><span><img style="width: 323px; height: 291px;" alt="Toolbox Image" src="image/Toolbox.png"></span></p>

<p class="MsoNormal" style="margin-left: 22.5pt; font-family: Helvetica,Arial,sans-serif;"><span>To
start utilizing the Facebook API, you will need to add the
FacebookService component to your project.<span style="">&nbsp;
</span>To do this just drag an instance of FacebookService from the
toolbox
onto the component tray and enter your API Key and Secret. </span><br>
</p>

<p class="MsoNormal" style="margin-left: 22.5pt; font-family: Helvetica,Arial,sans-serif;"><img style="width: 380px; height: 101px;" alt="FacebookService Toolbox" src="image/ServiceToolbox.png"><br>
<span><o:p></o:p></span></p>

<p class="MsoNormal" style="margin-left: 0.5in; font-family: Helvetica,Arial,sans-serif;"><span style=""><v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"> <v:stroke joinstyle="miter"> <v:formulas> <v:f eqn="if lineDrawn pixelLineWidth 0"> <v:f eqn="sum @0 1 0"> <v:f eqn="sum 0 0 @1"> <v:f eqn="prod @2 1 2"> <v:f eqn="prod @3 21600 pixelWidth"> <v:f eqn="prod @3 21600 pixelHeight">
<v:f eqn="sum @0 0 1"> <v:f eqn="prod @6 1 2"> <v:f eqn="prod @7 21600 pixelWidth"> <v:f eqn="sum @8 21600 0"> <v:f eqn="prod @7 21600 pixelHeight"> <v:f eqn="sum @10 21600 0"> </v:f> <v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"> <o:lock v:ext="edit" aspectratio="t">
</o:lock><v:shape id="Picture_x0020_1" o:spid="_x0000_i1025" type="#_x0000_t75" style="width: 285pt; height: 75.75pt; visibility: visible;"> <v:imagedata src="file:///C:%5CUsers%5CRPOWER%7E1.CLA%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_image001.png" o:title=""></v:imagedata><o:p></o:p></v:shape></v:path></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:formulas></v:stroke></v:shapetype></span></p>

<p class="MsoNormal" style="margin-left: 22.5pt; font-family: Helvetica,Arial,sans-serif;"><span style=""><br>
The FacebookService component contains methods that wrap all of the
methods of the Facebook API.&nbsp; The
following provides an example for getting all the friends of the logged
in
user.&nbsp; This method returns a generic
collection of user objects.&nbsp; The user
object is a strongly typed representation of a Facebook User profile.<br>
</span></p>

<p class="MsoNormal" style="margin-left: 22.5pt; font-family: Helvetica,Arial,sans-serif;"><span style="font-size: 11pt; line-height: 115%;"><v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"> <v:stroke joinstyle="miter"> <v:formulas> <v:f eqn="if lineDrawn pixelLineWidth 0"> <v:f eqn="sum @0 1 0"> <v:f eqn="sum 0 0 @1"> <v:f eqn="prod @2 1 2"> <v:f eqn="prod @3 21600 pixelWidth"> <v:f eqn="prod @3 21600 pixelHeight">
<v:f eqn="sum @0 0 1"> <v:f eqn="prod @6 1 2"> <v:f eqn="prod @7 21600 pixelWidth"> <v:f eqn="sum @8 21600 0"> <v:f eqn="prod @7 21600 pixelHeight"> <v:f eqn="sum @10 21600 0"> </v:f> <v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"> <o:lock v:ext="edit" aspectratio="t"></o:lock><v:shape id="Picture_x0020_1" o:spid="_x0000_i1025" type="#_x0000_t75" style="width: 285pt; height: 75.75pt; visibility: visible;"> <v:imagedata src="file:///C:%5CUsers%5CRPOWER%7E1.CLA%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_image001.png" o:title="">
</v:imagedata></v:shape></v:path></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:formulas></v:stroke></v:shapetype></span></p>

<p class="MsoNormal" style="margin-left: 22.5pt; font-family: Helvetica,Arial,sans-serif;"><b style=""><span style="font-size: 10pt; line-height: 115%;"><big><big>Using
the FacebookService Component</big></big><br>
</span></b><span style=""><o:p></o:p></span></p>

<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 22.5pt; line-height: normal; font-family: Helvetica,Arial,sans-serif;">
</p>

<p class="MsoNormal" style="margin-left: 22.5pt; font-family: Helvetica,Arial,sans-serif;">In
order to leverage the facebook platform from a winform application you
first need to establish a facebook session on behalf of the user of
your application.&nbsp; The first time a user is using your
application, this will require showing them a facebook login page and
then getting back a new secret key that is specific to their session
and also the session key associated with the facebook session that they
just initiated.&nbsp; The Toolkit provides a easy wrapper method that
allows you to do this.&nbsp; Allow you have to do is call
ConnectToFacebook on the instance of FacebookService that you created
by dragging it onto your form.&nbsp; After you have a valid session you
can access the various elements of data using accessor properties on
your FacebookService instance.<br>
</p>

<ul style="font-family: Helvetica,Arial,sans-serif;">

  <li>service.uid - the facebook user id of the logged in user</li>
  <li>service.SessionKey - The session key of the current facebook
session (used when posts requests to facebook on behalf of this user)</li>
  <li>service.ApplicationSecret - The application secret to use when
making requests in this session</li>
  <li>service.Api - an instance of the Facebook.Rest.Api class.&nbsp;
This is where all of the Facebook Rest interfaces are implemented.</li>
  <li>There is also an accessor for each facebook Rest Api (so you
don't have to go through the Api class to get there (ie. Friends,
Stream, Notifications, Events, Groups, etc.)<br>
  </li>
</ul>

<p class="MsoNormal" style="margin-left: 22.5pt; font-family: Helvetica,Arial,sans-serif;">Now
that we have a valid session, we can use the FacebookService to make
rest api calls.&nbsp; For more information on the rest api, go to <span style="font-size: 11pt; line-height: 115%;"><a href="http://wiki.developers.facebook.com/index.php/API">http://wiki.developers.facebook.com/index.php/API</a>.&nbsp;
T</span><span style="font-size: 11pt; line-height: 115%; font-family: Helvetica,Arial,sans-serif;">he
following provides an example for getting all
the friends of the logged in user.<span style="">&nbsp; </span>This
method returns a generic collection of user objects.<span style="">&nbsp;
</span>The user object is a strongly typed
representation of a Facebook User profile.</span></p>

<p class="MsoNormal" style="margin-left: 22.5pt;"><big><big><b style=""><span style="font-size: 10pt; line-height: 115%; font-family: &quot;Courier New&quot;;">Visual
C#</span></b></big></big><span style=""><o:p></o:p></span></p>

<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 22.5pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">using</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">
System.Collections.Generic;<o:p></o:p></span></p>

<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 22.5pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">using</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">
System.Collections.ObjectModel;<o:p></o:p></span></p>

<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 22.5pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">using</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> facebook.Schema;<o:p></o:p></span></p>

<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 22.5pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&#8230;<o:p></o:p></span></p>

<p class="MsoNormal" style="margin-left: 22.5pt;"><span style="font-size: 10pt; line-height: 115%; font-family: &quot;Courier New&quot;; color: rgb(43, 145, 175);">IList</span><span style="font-size: 10pt; line-height: 115%; font-family: &quot;Courier New&quot;;">&lt;<span style="color: rgb(43, 145, 175);">user</span>&gt; friends =
facebookService1.friends.getUserObjects();<o:p></o:p></span></p>

<p class="MsoNormal" style="margin-left: 22.5pt;"><b style=""><span style="font-size: 10pt; line-height: 115%; font-family: &quot;Courier New&quot;;">Visual
Basic<o:p></o:p></span></b></p>

<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 22.5pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">Imports</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">
System.Collections.Generic<o:p></o:p></span></p>

<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 22.5pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">Imports</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">
System.Collections.ObjectModel<o:p></o:p></span></p>

<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 22.5pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">Imports</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> facebook.Schema<o:p></o:p></span></p>

<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 22.5pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&#8230;<o:p></o:p></span></p>

<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="">&nbsp;&nbsp;&nbsp;
</span><span style="color: blue;">Dim</span> friends
<span style="color: blue;">As</span> IList(<span style="color: blue;">Of</span>
user)
= facebookService1.friends.getUserObjects()<o:p></o:p></span></p>

<p class="MsoNormal" style="margin-left: 22.5pt; font-family: Helvetica,Arial,sans-serif;"><b style=""><span style="font-size: 10pt; line-height: 115%;"><big><big>Using
the User Controls</big></big><br>
</span></b><span style=""><o:p></o:p></span></p>

<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 22.5pt; line-height: normal; font-family: Helvetica,Arial,sans-serif;">
</p>

<p class="MsoNormal" style="margin-left: 22.5pt; font-family: Helvetica,Arial,sans-serif;">If
you have just simple needs and want to display some typical facebook
information, we have provided some user controls.&nbsp; <br>
</p>

<ul style="font-family: Helvetica,Arial,sans-serif;">

  <li>EventList - Lists all the events owned by the logged in user</li>
  <li>FriendList - Lists all the friends of the logged in user</li>
  <li>FriendMap - Uses virtual earth to map the location of the logged
in user's friends</li>
  <li>PhotoAlbum - Simple album showing the photos that the logged in
user has posted<br>
  </li>
</ul>

<span style="font-family: Helvetica,Arial,sans-serif;">&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp; The following walks through the basic steps you would need
to do to use leverage one of these controls
</span><br style="font-family: Helvetica,Arial,sans-serif;">

<span style="font-family: Helvetica,Arial,sans-serif;"><span style=""></span>&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; 1. Drag a
FriendList from the toolbox onto the design surface for the form</span>&nbsp;&nbsp; <span style="font-family: Helvetica,Arial,sans-serif;">&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <img style="width: 472px; height: 246px;" alt="Friend List" src="image/WinformsToolbox.png"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 2. Find Load
in the Event list in the property window, type Form_Load.<span style="">&nbsp;
</span>Press Enter.<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <img style="width: 271px; height: 188px;" alt="FormLoad" src="image/formload.png"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 3. In the generated Form_Load
method, set the Friends property of the FriendList control
to the Collection returned by calling the GetFriends method of the
FacebookService.<span style="">&nbsp; </span>As shown here:<o:p></o:p></span><br style="font-family: Helvetica,Arial,sans-serif;">

<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; line-height: normal;"><b style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">Visual
C#<o:p></o:p></span></b></p>

<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style="color: blue;">private</span> <span style="color: blue;">void</span> Form_Load(<span style="color: blue;">object</span>
sender, <span style="color: rgb(43, 145, 175);">EventArgs</span> e)<o:p></o:p></span></p>

<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>{<o:p></o:p></span></p>

<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>friendList1.Friends =
facebookService1.friends.getUserObjects();<o:p></o:p></span></p>

<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>}<o:p></o:p></span></p>

<p class="MsoNormal" style="margin-left: 22.5pt;"><b style=""><span style="font-size: 10pt; line-height: 115%; font-family: &quot;Courier New&quot;;">Visual
Basic<o:p></o:p></span></b></p>

<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="">&nbsp;
</span><span style="color: blue;">&nbsp;&nbsp;&nbsp; Private</span> <span style="color: blue;">Overloads</span> <span style="color: blue;">Sub</span>
OnLoad()<o:p></o:p></span></p>

<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style="">&nbsp;&nbsp;&nbsp;</span>friendList1.Friends =
FacebookService1.friends.getUserObjects()<o:p></o:p></span></p>

<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style=""> </span><span style="color: blue;">End</span> <span style="color: blue;">Sub<o:p></o:p></span></span></p>

<p class="MsoNormal" style="margin-left: 22.5pt; font-family: Helvetica,Arial,sans-serif;">
</p>

<span style="font-family: &quot;Courier New&quot;;"><span style="font-weight: bold;"></span></span>
</body></html>